<script>

    $(document).ready(function () {
        @if( count($errors)==1 && $errors->all()[0] == $params['success'])
            swal({
                title: "信息更新成功！",
                text: "2秒后自动关闭。",
                type: "success",
                timer: 2000,
                showConfirmButton: false
            },function(){
                var index=parent.layer.getFrameIndex(window.name);
                // console.log(index);
                parent.layer.close(index);
            });
        @endif
    });
</script>
